<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property int $uid
 * @property string $username
 * @property string $auth_key
 * @property string $password_hash
 * @property string $email
 * @property int $credit
 * @property int $groupid
 * @property int $createnum
 * @property int $editnum
 * @property string $password_reset_token
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['auth_key'], 'required'],
            [['credit', 'groupid', 'createnum', 'editnum'], 'integer'],
            [['username', 'email'], 'string', 'max' => 128],
            [['auth_key'], 'string', 'max' => 32],
            [['password_hash', 'password_reset_token'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'uid' => 'Uid',
            'username' => 'Username',
            'auth_key' => 'Auth Key',
            'password_hash' => 'Password Hash',
            'email' => 'Email',
            'credit' => 'Credit',
            'groupid' => 'Groupid',
            'createnum' => 'Createnum',
            'editnum' => 'Editnum',
            'password_reset_token' => 'Password Reset Token',
        ];
    }
}
